home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / utilit~1 / flut39st.zoo / fileutils-3.9 / PATCHES-ST < prev    next >
Encoding:
Text File  |  1994-03-26  |  4.4 KB  |  149 lines

  1. --- 1.1    1994/03/25 18:27:46
  2. +++ lib/system.h    1994/03/25 18:29:02
  3. @@ -129,7 +129,7 @@
  4.  #endif
  5.  #undef HAVE_MAJOR
  6.  
  7. -#ifdef _POSIX_VERSION
  8. +#if defined(_POSIX_VERSION) || defined(atarist)
  9.  #include <utime.h>
  10.  #else /* not _POSIX_VERSION */
  11.  struct utimbuf
  12. --- 1.1    1994/03/26 10:10:10
  13. +++ lib/mountlist.c    1994/03/26 18:16:12
  14. @@ -99,6 +99,15 @@
  15.  #define MOUNTED_GETMNTTBL
  16.  #endif
  17.  
  18. +#ifdef atarist
  19. +#include <dirent.h>
  20. +#include <stat.h>
  21. +#include <sys/statfs.h>
  22. +#include <osbind.h>
  23. +#include <mintbind.h>
  24. +extern int __mint;
  25. +#endif
  26. +
  27.  #ifdef MOUNTED_GETMNTENT1    /* 4.3BSD, SunOS, HP-UX, Dynix, Irix.  */
  28.  /* Return the value of the hexadecimal number represented by CP.
  29.     No prefix (like '0x') or suffix (like 'h') is expected to be
  30. @@ -199,6 +208,118 @@
  31.    me->me_next = NULL;
  32.    mount_list = mtail = me;
  33.  
  34. +/* The following routine was taken from an earlier port */
  35. +/* of the fsutils (3.3) by somebody else (? ERS ?).     */
  36. +/* It was adapted by HPP to show all filesystems on U:  */
  37. +#ifdef __MINT__                 /* MiNT on Atari ST */
  38. +  {
  39. +    static char ubuf[128] = "u:/";
  40. +    char _ubuf[128];
  41. +    DIR *udrv;
  42. +    struct dirent *next;
  43. +    struct stat statbuf;
  44. +    long drvmap, ssp;
  45. +    int i;
  46. +    int r;
  47. +    int offset;
  48. +    struct mount_entry *him;
  49. +    struct statfs stbuf;
  50. +
  51. +    struct {
  52. +      long ninodes, nzones;
  53. +      long finodes, fzones;
  54. +      short version;
  55. +      short increment;
  56. +      long res1, res2, res3, res4;
  57. +    } mfsinfo;
  58. +
  59. +    offset = (Dgetdrv() == 'U'-'A') ? 2 : 0;
  60. +    ssp = Super(0L);
  61. +    drvmap = *((long *)0x4c2);  /* get which drives are attached */
  62. +    if ((*(short *)0x4a6) != 2)
  63. +      drvmap &= ~2;             /* drive B: isn't really there */
  64. +    Super(ssp);
  65. +
  66. +    for (i = 0; i < 32; i++)
  67. +    {
  68. +      if (drvmap & (1L << i))
  69. +      {
  70. +          /* drive 'a' + i ist there. */
  71. +        me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
  72. +        me->me_devname = xstrdup("a:");
  73. +        me->me_devname[0] = 'a'+i;
  74. +        me->me_mountdir = xstrdup(ubuf);
  75. +        me->me_mountdir[0] = me->me_devname[0];
  76. +        me->me_dev = i;
  77. +        me->me_next = NULL;
  78. +
  79. +    /* It's possible to Dcntl on minixfs */
  80. +        _unx2dos (me->me_mountdir, _ubuf);
  81. +        if(Dcntl(0x104, _ubuf, (long) &mfsinfo)==0)
  82. +          me->me_type = xstrdup( "minix" );
  83. +        else
  84. +          me->me_type = xstrdup( (i < 16) ? "tos" : "pseudo" );
  85. +    
  86. +        mtail->me_next = me;
  87. +        mtail = me;
  88. +      }
  89. +    }
  90. +    udrv = opendir(ubuf);
  91. +    if (udrv)
  92. +    {
  93. +      while (next = readdir(udrv))
  94. +      {
  95. +        strcpy(ubuf+3, next->d_name);
  96. +        lstat(ubuf, &statbuf);
  97. +
  98. +        if ( (statbuf.st_mode & S_IFMT) == S_IFDIR )
  99. +        {
  100. +          int replaced = 0;
  101. +
  102. +          for (him = mount_list->me_next; him; him = him->me_next)
  103. +          {
  104. +            if (him->me_devname[0] - 'a' == statbuf.st_dev)
  105. +            {
  106. +              replaced = 1;
  107. +              free(him->me_mountdir);
  108. +              him->me_mountdir = xstrdup(ubuf+offset);
  109. +            }
  110. +          }
  111. +
  112. +          /* Show all subdirs of U: that are not physical drives */
  113. +          /* as U:-mounted filesystems. This shows U:\PROC etc.  */
  114. +          /* Only do this if MiNT 0.99 or higher is running.     */
  115. +          /* (Since Dfree() changed in MiNT 0.97).               */
  116. +          if (!replaced && (__mint >= 99) &&
  117. +              (statbuf.st_dev >= 32)) /* Pseudodrive */
  118. +          {
  119. +            char *ptr;
  120. +
  121. +            me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
  122. +            /* mountdir is /xxx (/proc, for instance */
  123. +            me->me_mountdir = xstrdup(ubuf+offset);
  124. +            /* devname is filesys-name (procfs, for instance). */
  125. +            /* this is constructed by catting 'fs' after the dirname */
  126. +            ptr = ubuf+offset;
  127. +            while (*ptr != 0x00)
  128. +              ptr += 1;
  129. +            *ptr++ = 'f';
  130. +            *ptr++ = 's';
  131. +            *ptr++ = ':';
  132. +            *ptr = 0x00;
  133. +            me->me_devname = xstrdup(ubuf+offset+1);
  134. +            me->me_dev = statbuf.st_dev;
  135. +            me->me_next = NULL;
  136. +            me->me_type = xstrdup( "pseudo" );
  137. +            mtail->me_next = me;
  138. +            mtail = me;
  139. +          }
  140. +        } /* End of if (directory in U:) */
  141. +      } /* End of while (not end of U:) */
  142. +    }
  143. +  }
  144. +#endif /* __MINT__ */
  145. +
  146.  #ifdef MOUNTED_GETMNTENT1    /* 4.3BSD, SunOS, HP-UX, Dynix, Irix.  */
  147.    {
  148.      struct mntent *mnt;
  149.